package com.yanqu.road.server.cmd.player;

import com.yanqu.road.entity.enums.eGamePlayerEventType;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.player.RecordScreenShareProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameProtocol;

/**
 * @author ：zfr
 * @date ：2022/6/22 14:39
 */
@Cmd(code = GameProtocol.S_RECORD_SCREEN_SHARE, desc = "录屏分享")
public class RecordScreenShareCmd extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        player.notifyListener(eGamePlayerEventType.RecordScreenShare.getValue());
    }

    @Override
    public void sendData(GamePlayer player) {
        RecordScreenShareProto.RecordScreenShareRespMsg.Builder respMsg = RecordScreenShareProto.RecordScreenShareRespMsg.newBuilder();
        respMsg.setRet(ret);
        player.sendPacket(ClientProtocol.U_RECORD_SCREEN_SHARE, respMsg);
    }
}
